Fix loading scaled-down jpegs
authorMatthias Clasen <mclasen@redhat.com>
Thu, 5 Nov 2009 15:29:34 +0000 (10:29 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 5 Nov 2009 15:29:34 +0000 (10:29 -0500)
The assumption that scale_num will be automatically be 1 is no longer
with libjpeg7. So set it explicitly. Bug #588740.

gdk-pixbuf/io-jpeg.c

index 5435f5b2524a3a37648b300161a93cf69bfb25ed..07308e3706540ed077a816fb8b193c06a76248e1 100644 (file)
@@ -922,6 +922,7 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
                        }
                        
                        for (cinfo->scale_denom = 2; cinfo->scale_denom <= 8; cinfo->scale_denom *= 2) {
+                               cinfo->scale_num = 1;
                                jpeg_calc_output_dimensions (cinfo);
                                if (cinfo->output_width < width || cinfo->output_height < height) {
                                        cinfo->scale_denom /= 2;